package butines.core.gui.style;

import java.awt.Graphics2D;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;

public class TextShadow {

    private List<Point> offsets = new ArrayList<Point>();
    private List<Text> shadows = new ArrayList<Text>();
    
    private Text text;
    
    public void draw(Graphics2D g2d, int sx, int sy, String text, int wbox, int hbox) {
        
        for (int i = 0; i < shadows.size(); i++) {
            Point offset = offsets.get(i);
            Text shadow = shadows.get(i);
            shadow.draw(g2d, sx + offset.x, sy + offset.y, text, wbox, hbox);
        }
        
    }

    public List<Point> getOffsets() {
        return offsets;
    }

    public List<Text> getShadows() {
        return shadows;
    }
    
    public void add(int hshadow, int vshadow, Text shadow) {
        getOffsets().add(new Point(hshadow, vshadow));
        getShadows().add(shadow);
    }
    
    public void add(int hshadow, int vshadow) {
        getOffsets().add(new Point(hshadow, vshadow));
        getShadows().add(text.copy());
    }

    public Text getText() {
        return text;
    }

    public void setText(Text defaultText) {
        this.text = defaultText;
    }
 
}
